<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input type="text" id = "ipt">

</body>
 <script>
  const data ={
        name:'屁股斯'
      }
      let a = ''
      Object.defineProperty(data,'name',{
        get(){
          console.log('我是get');
          return a
        },
        set(val){
          console.log('name改变了o');
          console.log(val);
          document.querySelector('#ipt').value = val
          a = val
        }
      })
      document.querySelector('#ipt').addEventListener('input',(e)=>{
        // console.log(e);
        data.name = e.target.value
      })
    
 </script>
</html>